Ext.define('App.management.pm.view.ProjectInfoPanel', {
    extend: 'Ext.Component',
    alias: ['widget.ProjectInfoPanel'],
    baseCls: 'ProjectInfo',//基础样式类
    requires:['App.management.pm.view.ProjectSelectionWindow'],
    tpl: [
        '  <div  style="color: #fff;position: absolute;bottom: 10px;right: 10px;cursor: pointer;" id="{id}-pi" data-ref="pi">',
        '     <span>当前项目：</span>',
        '     <tpl if="project">',
        '     <span>{project.name}</span>',
        '     <tpl else>',
        '     <span>无可管理项目</span>',
        '     </tpl>',
        '  </div>'],
    initEvents: function () {
        var pi = this.getEl().selectNode('div[data-ref="pi"]', false);
        pi.on({
            click: function (e, t, eOpts) {
                var view = this;
                view.showProjectSelectionWindow(function () {

                });
            },
            scope: this
        });
    },
    initRenderData: function () {
        this.setData({project: app.project});
        return this.callParent(arguments);
    },
    showProjectSelectionWindow: function (callback) {
        Ext.create({
            xtype: 'ProjectSelectionWindow',
            owner: this
        }).show();
    }
})